#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s;
    cin >> s;

    int sum = 0, k = 1, n = s.size();
    for (int i = 0; i < n - 1; i++)
    {
        if (s[i] >= '0' && s[i] <= '9')
        {
            sum += k * (s[i] - '0');
            k++;
        }
    }
    int end = sum % 11;
    if (end == (s[n - 1] - '0') || (end == 10 && s[n - 1] == 'X')) cout << "Right";
    else {
        s[n - 1] = (end == 10 ? 'X' : (end + '0'));
        cout << s;
    }
}